function DialogAssignee(container, item, callbackFunc, options) {
  this._container = container;
  this._item = item;
  this._callbackFunc = callbackFunc;
  
  this._php = (options && options.php) ? options.php : null;
  this._condition = (options && options.condition) ? options.condition : null;
  this._close = (options && options.close) ? options.close : function() { };
  
  this._createElements();
};

DialogAssignee.prototype._createElements = function() {
  this._loadData();
};

DialogAssignee.prototype._loadData = function() {
  this._users = null;
  this._retrieveUsers();
};

DialogAssignee.prototype._verifyData = function() {
  if (this._users) {
    this._updateElements();
  }
};

DialogAssignee.prototype._retrieveUsers = function() {
  var _self = this;
  new RequestUtils()._read('user', null, this._condition, null, null, null, null, function(result, params) { _self._users = result.data;
                                                                                                             _self._verifyData.call(_self);
                                                                                                           }, { php: this._php });
};

DialogAssignee.prototype._updateElements = function() {
  var unique, input, _self = this;
  
  DOMUtils.removeChildElements(this._container);
  unique = MiscUtils.unique();
  new DialogAssigneeGui(unique, this._container, this._item, { users: this._users });
  
  input = document.getElementById(unique + '_none');
  input.onclick = function() { if (_self._item.product) {
                                 _self._item.assignee = Assignee.instance();
                               } else {
                                 _self._item.assignee = User.instance();
                               }
                             };
  
  for (var i = 0, il = this._users.length; i < il; i++) {
    var user = this._users[i];
    input = document.getElementById(unique + '_' + i);
    input._user = user;
    input.onclick = function() { if (_self._item.product) {
	                                 var assignee = MiscUtils.clone(this._user);
	                                 assignee.trackId = MiscUtils.unique();
	                                 assignee.userId = this._user.id;
	                                 assignee.id = (_self._item.assignee) ? _self._item.assignee.id : null;
	                                 _self._item.assignee = assignee;
	                               } else {
	                                 _self._item.assignee = this._user;
	                               }
                               }
  }
  
  input = document.getElementById(unique + '_save');
  input.onclick = function() { if ((_self._item.product && _self._item.assignee.userId) || (!_self._item.product && _self._item.assignee)) {
                                 _self._callbackFunc();
                               } else {
                                 _self._close();
                               }
                             };
  
  input = document.getElementById(unique + '_cancel');
  input.onclick = function() { _self._close(); };
};
